package com.company;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.IOException;

public class JsoupUtils {

    public static Document parseHtml(String htmlString){
        return Jsoup.parse(htmlString);
    }

    public static Document getRequest(String url){
        Document document = null;
        try {
            document = Jsoup.connect(url).get();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return document;
    }

    public static Document postRequest(String url){
        Document document = null;
        try {
            document = Jsoup.connect(url).post();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return document;
    }

}
